using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
	public static class BO_cms_settings_current {
		public static DataTable SelectAll(int status) {
			try {
				usp_cms_settings_current_select_all entity = new usp_cms_settings_current_select_all();
				entity.STATUS = status;
				return BO_Actions<usp_cms_settings_current_select_all>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectTop(int rows, int status) {
			try {
				usp_cms_settings_current_select_top entity = new usp_cms_settings_current_select_top();
				entity.NUMBERRECORD = rows;
				entity.STATUS = status;
				return BO_Actions<usp_cms_settings_current_select_top>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable Search(int setting_id) {
			try {
				usp_cms_settings_current_search entity = new usp_cms_settings_current_search();
				entity.SETTING_ID = setting_id;

				return BO_Actions<usp_cms_settings_current_search>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
			try {
				usp_cms_settings_current_select_paged entity = new usp_cms_settings_current_select_paged ();
				entity.STARTINDEX = startIndex;
				entity.MAXRECORDS = pageCount;
				entity.STATUS = status;
				return BO_Actions<usp_cms_settings_current_select_paged>.ExecuteAndReturnDataTable(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Insert( int setting_group_id, string setting_key, string setting_name, string setting_description, string setting_value, int setting_type_id, string setting_type_value, int sort_display, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status) {
			try {
				usp_cms_settings_current_insert entity = new usp_cms_settings_current_insert();
                entity.SETTING_GROUP_ID = setting_group_id;
                entity.SETTING_KEY = setting_key;
                entity.SETTING_NAME = setting_name;
                entity.SETTING_DESCRIPTION = setting_description;
                entity.SETTING_VALUE = setting_value;
                entity.SETTING_TYPE_ID = setting_type_id;
                entity.SETTING_TYPE_VALUE = setting_type_value;
                entity.SORT_DISPLAY = sort_display;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

				return BO_Actions<usp_cms_settings_current_insert>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static string Update( int setting_id, int setting_group_id, string setting_key, string setting_name, string setting_description, string setting_value, int setting_type_id, string setting_type_value, int sort_display, DateTime created_date, string created_by, DateTime modify_date, string modify_by, bool status) {
			try {
				usp_cms_settings_current_update entity = new usp_cms_settings_current_update();
                entity.SETTING_ID = setting_id;
                entity.SETTING_GROUP_ID = setting_group_id;
                entity.SETTING_KEY = setting_key;
                entity.SETTING_NAME = setting_name;
                entity.SETTING_DESCRIPTION = setting_description;
                entity.SETTING_VALUE = setting_value;
                entity.SETTING_TYPE_ID = setting_type_id;
                entity.SETTING_TYPE_VALUE = setting_type_value;
                entity.SORT_DISPLAY = sort_display;
                entity.CREATED_DATE = created_date;
                entity.CREATED_BY = created_by;
                entity.MODIFY_DATE = modify_date;
                entity.MODIFY_BY = modify_by;
                entity.STATUS = status;

				return BO_Actions<usp_cms_settings_current_update>.ExecuteAndReturnStringValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Delete(string ids, string spliter, int delete_type) {
			try {
				usp_cms_settings_current_delete entity = new usp_cms_settings_current_delete();
				entity.IDS = ids;
				entity.SPLITER = spliter;
				entity.DELETE_TYPE = delete_type;

				return BO_Actions<usp_cms_settings_current_delete>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
		public static bool Restore(int setting_id) {
			try {
				usp_cms_settings_current_restore entity = new usp_cms_settings_current_restore();
				entity.SETTING_ID = setting_id;

				return BO_Actions<usp_cms_settings_current_restore>.ExecuteAndReturnBooleanValue(entity);
			} catch (Exception ex) {
				throw ex;
			}
		}
	}
}

